package com.wujing.niming


/***
 * 匿名子类的用法
 */
object NoNameDemo01 extends App {
  var m=new Monster {
    override var name: String = "_"

    override def cry(): Unit = {
      println("匿名子类的实现")
    }
  }
  m.cry()

}

abstract class Monster{
  var  name:String
  def cry()
}